package com.qc.service.impl;

import java.sql.SQLException;
import java.util.List;

import javax.annotation.Resource;

import org.springframework.stereotype.Service;

import com.qc.dao.UserDao;
import com.qc.entity.BossEntityVo;
import com.qc.entity.BannerEntity;
import com.qc.entity.EducationEntity;
import com.qc.entity.HeightEntity;
import com.qc.entity.InterestUserEntity;
import com.qc.entity.OccupationEntity;
import com.qc.entity.OrderCommentEntity;
import com.qc.entity.PhoneVersionEntity;
import com.qc.entity.PointEntity;
import com.qc.entity.ReportEntity;
import com.qc.entity.SecScheduleCommentEntity;
import com.qc.entity.SecScheduleReplyCommentEntity;
import com.qc.entity.SecretaryEntity;
import com.qc.entity.SecretaryVideoEntity;
import com.qc.entity.SkillTagEntity;
import com.qc.entity.UserAuthVerifyEntity;
import com.qc.entity.UserBossEntity;
import com.qc.entity.UserBossScheduleEntity;
import com.qc.entity.UserCashEntity;
import com.qc.entity.UserEntity;
import com.qc.entity.UserEntityVo;
import com.qc.entity.UserFeedBackEntity;
import com.qc.entity.UserMoneyLogEntity;
import com.qc.entity.UserSecScheduleEntity;
import com.qc.entity.UserSecretaryEntity;
import com.qc.entity.UserVerifyEntityVo;
import com.qc.entity.search.UserBossSearchEntity;
import com.qc.entity.search.UserSecSearchEntity;
import com.qc.service.UserService;

@SuppressWarnings("rawtypes")
@Service
public class UserServiceImpl implements UserService {

	@Resource
	UserDao userDao;
	
	@Override
	public long register(UserEntity entity) throws SQLException {
		// TODO Auto-generated method stub
		return userDao.register(entity);
	}

	@Override
	public String getMobileCode(String mobile) {
		// TODO Auto-generated method stub
		return userDao.getMobileCode(mobile);
	}

	@Override
	public long saveCode(String mobile, String code) {
		// TODO Auto-generated method stub
		return userDao.saveCode(mobile, code);
	}

	@Override
	public UserEntity userLogin(String mobile, String pwd) {
		// TODO Auto-generated method stub
		return userDao.userLogin(mobile,pwd);
	}

	@Override
	public long forgetPwd(String mobile, String pwd) {
		// TODO Auto-generated method stub
		return userDao.forgetPwd(mobile, pwd);
	}

	@Override
	public long updateCodeByMobile(String mobile, String code) {
		// TODO Auto-generated method stub
		return userDao.updateCodeByMobile(mobile, code);
	}

	@Override
	public long updateRole(int userRole, long userId) {
		// TODO Auto-generated method stub
		return userDao.updateRole(userRole, userId);
	}

	@Override
	public long updateAvatar(String avatarName, long userId) {
		// TODO Auto-generated method stub
		return userDao.updateAvatar(avatarName, userId);
	}

	@Override
	public long updateUserInfo(UserEntity entity)  throws SQLException{
		// TODO Auto-generated method stub
		return userDao.updateUserInfo(entity);
	}

	@Override
	public long updateBindMobile(String mobile, long userId)  throws SQLException{
		// TODO Auto-generated method stub
		return userDao.updateBindMobile(mobile, userId);
	}

	@Override
	public long updateUserPwd(UserEntity entity) {
		// TODO Auto-generated method stub
		return userDao.updateUserPwd(entity);
	}

	@Override
	public UserEntity getUserInfoByUserId(long userId) {
		// TODO Auto-generated method stub
		return userDao.getUserInfoByUserId(userId);
	}

	@Override
	public long saveFeedBack(UserFeedBackEntity entity) {
		// TODO Auto-generated method stub
		return userDao.saveFeedBack(entity);
	}

	@Override
	public long saveSecretarySchedule(UserSecScheduleEntity entity) {
		return userDao.saveSecretarySchedule(entity);
	}
	
	@Override
	public int deleteSecretarySchedule(UserSecScheduleEntity entity) {
		return userDao.deleteSecretarySchedule(entity);
	}
	

	@Override
	public List<UserSecScheduleEntity> getSecScheduleByUserId(long userId) {
		// TODO Auto-generated method stub
		return userDao.getSecScheduleByUserId(userId);
	}

	@Override
	public List<SkillTagEntity> getAllSkillTag() {
		// TODO Auto-generated method stub
		return userDao.getAllSkillTag();
	}

	@Override
	public List<UserSecScheduleEntity> getSecScheduleByCity(UserSecSearchEntity entity) {
		// TODO Auto-generated method stub
		return userDao.getSecScheduleByCity(entity);
	}

	@Override
	public long updateSecScheduleRead(long ssId) {
		// TODO Auto-generated method stub
		return userDao.updateSecScheduleRead(ssId);
	}

	@Override
	public long saveSecScheduleComment(SecScheduleCommentEntity entity) {
		// TODO Auto-generated method stub
		return userDao.saveSecScheduleComment(entity);
	}

	@Override
	public long saveSecScheduleReplyComment(SecScheduleReplyCommentEntity entity) {
		// TODO Auto-generated method stub
		return userDao.saveSecScheduleReplyComment(entity);
	}

	@Override
	public List<SecScheduleCommentEntity> getSecretaryCommentBySSID(long secScheduleId) {

		return userDao.getSecretaryCommentBySSID(secScheduleId);
	}

	@Override
	public long updateSecretaryInfo(UserSecretaryEntity entity) {

		return userDao.updateSecretaryInfo(entity);
	}

	@Override
	public UserSecretaryEntity getSecretaryInfoByUserId(long bossUserId, long userId) {
		// TODO Auto-generated method stub
		return userDao.getSecretaryInfoByUserId(bossUserId,userId);
	}

	@Override
	public long updateBossInfo(UserBossEntity entity) {
		// TODO Auto-generated method stub
		return userDao.updateBossInfo(entity);
	}

	@Override
	public UserBossEntity getBossInfoByUserId(long secUserId,long userId) {
		// TODO Auto-generated method stub
		return userDao.getBossInfoByUserId(secUserId,userId);
	}

	@Override
	public long saveBossSchedule(UserBossScheduleEntity entity) {
		// TODO Auto-generated method stub
		return userDao.saveBossSchedule(entity);
	}

	@Override
	public List<UserBossScheduleEntity> getBossScheduleByUserId(long userId) {
		// TODO Auto-generated method stub
		return userDao.getBossScheduleByUserId(userId);
	}

	@Override
	public List<UserBossScheduleEntity> getBossScheduleByCity(UserBossSearchEntity entity) {
		// TODO Auto-generated method stub
		return userDao.getBossScheduleByCity(entity);
	}

	@Override
	public long updateRegistrationId(String registrationId, long userId) {
		// TODO Auto-generated method stub
		return userDao.updateRegistrationId(registrationId, userId);
	}

	@Override
	public long interestUser(InterestUserEntity entity) {
		// TODO Auto-generated method stub
		return userDao.interestUser(entity);
	}

	@Override
	public long cancelInterestUser(InterestUserEntity entity) {
		// TODO Auto-generated method stub
		return userDao.cancelInterestUser(entity);
	}

	@Override
	public List<InterestUserEntity> getInterestUser(long receiveUserId, int type) {
		// TODO Auto-generated method stub
		return userDao.getInterestUser(receiveUserId,type);
	}

	@Override
	public List<OrderCommentEntity> getOrderCommentByUserId(long userId) {
		// TODO Auto-generated method stub
		return userDao.getOrderCommentByUserId(userId);
	}

	@Override
	public UserSecScheduleEntity getSecScheduleBySSId(long ssId, long userId) {
		// TODO Auto-generated method stub
		return userDao.getSecScheduleBySSId(ssId, userId);
	}

	@Override
	public long delSecScheduleComment(SecScheduleCommentEntity entity) {
		// TODO Auto-generated method stub
		return userDao.delSecScheduleComment(entity);
	}

	@Override
	public SecretaryVideoEntity getSecretaryVideoByUserId(long userId) {
		// TODO Auto-generated method stub
		return userDao.getSecretaryVideoByUserId(userId);
	}

	@Override
	public long addSecretaryVideo(SecretaryVideoEntity entity) {
		// TODO Auto-generated method stub
		return userDao.addSecretaryVideo(entity);
	}

	@Override
	public long updateSecretaryVideo(SecretaryVideoEntity entity) {
		// TODO Auto-generated method stub
		return userDao.updateSecretaryVideo(entity);
	}

	@Override
	public long updateSecretaryVideoRead(long userId) {
		// TODO Auto-generated method stub
		return userDao.updateSecretaryVideoRead(userId);
	}

	@Override
	public long addAuthVerify(UserAuthVerifyEntity entity) {
		// TODO Auto-generated method stub
		return userDao.addAuthVerify(entity);
	}

	@Override
	public UserAuthVerifyEntity getAuthVerify(long userId) {
		// TODO Auto-generated method stub
		return userDao.getAuthVerify(userId);
	}

	@Override
	public long saveTokenByUserId(long userId, String token) {
		// TODO Auto-generated method stub
		return userDao.saveTokenByUserId(userId,token);
	}

	@Override
	public UserEntity getUserInfoByPwdAndUserId(long userId, String pwd) {
		// TODO Auto-generated method stub
		return userDao.getUserInfoByPwdAndUserId(userId, pwd);
	}
	
	@Override
    public int getListUserCount(String userName, String isAuth, String sex,String userRole) {
	    
        return userDao.getListUserCount(userName, isAuth, sex,userRole);
    }

    @Override
    public List getAllUser(String userName, String isAuth,
            String sex,String userRole, int pageNo, int pageSize) {

        return userDao.getAllUser(userName, isAuth, sex,userRole, pageNo, pageSize);
    }

    @Override
    public UserEntityVo getUserId(String userId) {

        return userDao.getUserId(userId);
    }
    
    @Override
    public BossEntityVo getBossUserId(String userId) {
        
        return userDao.getBossUserId(userId);
    }

    @Override
    public int deleteUserId(String userId) {

        return userDao.deleteUserId(userId);
    }

    @Override
    public int coutAuditing(String userRole) {

        return userDao.coutAuditing(userRole);
    }

	@Override
	public long updateAuthVerify(UserAuthVerifyEntity entity) {

	    return userDao.updateAuthVerify(entity);
	}

	@Override
	public List<HeightEntity> getAllHeight() {

	    return userDao.getAllHeight();
	}

	@Override
	public List<EducationEntity> getAllEducation() {

	    return userDao.getAllEducation();
	}

	@Override
	public List<OccupationEntity> getAllOccupation() {

	    return userDao.getAllOccupation();
	}

	@Override
	public List<SecretaryEntity> getAllOneSpecialty() {

	    return userDao.getAllOneSpecialty();
	}

	@Override
	public List<SecretaryEntity> getAllTwoSpecialty(String parent) {

	    return userDao.getAllTwoSpecialty(parent);
	}

    @Override
    public int getListBossShCount(String nickname) {

        return userDao.getListBossShCount(nickname);
    }

    @Override
    public List getAllBossSh(String nickname, int pageNo, int pageSize) {

        return userDao.getAllBossSh(nickname, pageNo, pageSize);
    }

    @Override
    public int deleteBossShId(String userId) {

        return userDao.deleteBossShId(userId);
    }

    @Override
    public UserBossScheduleEntity getBossSh(String userId) {

        return userDao.getBossSh(userId);
    }

    @Override
    public int getListVerifyCount(String mobile, String userRole, String sex) {

        return userDao.getListVerifyCount(mobile, userRole, sex);
    }

    @Override
    public List getListAllVerify(String mobile, String userRole, String sex,
            int pageNo, int pageSize) {

        return userDao.getListAllVerify(mobile, userRole, sex, pageNo, pageSize);
    }

    @Override
    public UserVerifyEntityVo getVerifyId(String id) {

        return userDao.getVerifyId(id);
    }

    @Override
    public int updateVType(String vType, String id,String describe) {

        return userDao.updateVType(vType, id,describe);
    }

    
	@Override
	public List<BannerEntity> getBannerByType(BannerEntity entity) {
		return userDao.getBannerByType(entity);
	}

	@Override
	public long addCashOut(UserCashEntity entity) {
		return userDao.addCashOut(entity);
	}

	@Override
	public long updateUserBalance(double cashOut, long userId) {
		return userDao.updateUserBalance(cashOut,userId);
	}

	@Override
	public List<UserCashEntity> getUserCashDetail(long userId) {
		return userDao.getUserCashDetail(userId);
	}

	@Override
	public long addMoneyLog(UserMoneyLogEntity entity) {

		return userDao.addMoneyLog(entity);
	}

	@Override
	public PhoneVersionEntity getPhoneVersionByType(int type) {
		
		return userDao.getPhoneVersionByType(type);
	}

	@Override
	public long reportScreenshot(ReportEntity entity) {
		return userDao.reportScreenshot(entity);
	}

	@Override
	public UserSecScheduleEntity getUserSecScheduleId(String ssId) {

		return userDao.getUserSecScheduleId(ssId);
	}

	@Override
	public int updateOrdersState(long userId, int ordersState) {

		return userDao.updateOrdersState(userId, ordersState);
	}

	@Override
	public int updateCommentCountPlus(long ssId) {

		return userDao.updateCommentCountPlus(ssId);
	}

	@Override
	public int updateCommentCountReduce(long ssId) {

		return userDao.updateCommentCountReduce(ssId);
	}

	@Override
	public UserEntity getUserName(String userame) {

		return userDao.getUserName(userame);
	}

	@Override
	public int updateTransactionNumber(long userId) {

		return userDao.updateTransactionNumber(userId);
	}

	@Override
	public List<UserSecScheduleEntity> listRanking(String stateTime,String endTime, int pageNo, int pageSize) {

		return userDao.listRanking(stateTime,endTime, pageNo, pageSize);
	}

	@Override
	public int updatePoint(long ssId) {

		return userDao.updatePoint(ssId);
	}

	@Override
	public int getPointCount(long ssId, long userId) {

		return userDao.getPointCount(ssId, userId);
	}

	@Override
	public int savePoint(PointEntity pointEntity) {

		return userDao.savePoint(pointEntity);
	}

}
